<html>
<head><meta charset="utf-8"><title>Why is Clone a super trait of Copy? · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Why.20is.20Clone.20a.20super.20trait.20of.20Copy.3F.html">Why is Clone a super trait of Copy?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="212196623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Why%20is%20Clone%20a%20super%20trait%20of%20Copy%3F/near/212196623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Quy Nguyen <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Why.20is.20Clone.20a.20super.20trait.20of.20Copy.3F.html#212196623">(Oct 04 2020 at 00:11)</a>:</h4>
<p>This question just randomly popped into my mind today when I taught someone they had to derive both Clone and Copy. Why is Clone a supertrait of Copy and not just a blanket impl (<code>impl &lt;T&gt; Clone for T where T: Copy</code>)?</p>



<a name="212197325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Why%20is%20Clone%20a%20super%20trait%20of%20Copy%3F/near/212197325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Why.20is.20Clone.20a.20super.20trait.20of.20Copy.3F.html#212197325">(Oct 04 2020 at 00:28)</a>:</h4>
<p>Because coherence.  That impl would overlap with anything that you can write, so it would de facto keep anyone from ever implementing <code>Clone</code>.</p>
<p>One day we'll have enough specialization that that can just be a default implementation but still overridable by others, and then just <code>impl Copy for Foo {}</code> will be enough to get both.  But for now, manual it is.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>